﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="AddProduct.aspx.cs" Inherits="PowerToolsWeb.Admin.AddProduct" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>发布商品</title>
    <link type="text/css" href="../Style/admin.css" rel="Stylesheet" />
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <div class="DivTitle" style="vertical-align: bottom">
            <table cellpadding="0" cellspacing="0" border="0">
                <tr>
                    <td align="left">
                        <img alt="" src="../Style/admin/tb.gif" width="14" height="14" /><span id="spanTitle"
                            runat="server">发布商品</span>
                    </td>
                    <td align="right">
                    </td>
                </tr>
            </table>
        </div>
        <div class="messdiv">
            <dl>
                <dt>商品名称：</dt>
                <dd>
                    <asp:TextBox ID="txbProductName" runat="server" CssClass="textBox"></asp:TextBox>&nbsp;*</dd></dl>
            <dl>
                <dt>所属类别：</dt>
                <dd>
                    <asp:DropDownList ID="ddlType" runat="server">
                    </asp:DropDownList>
                    &nbsp;*
                </dd>
            </dl>
            <dl>
                <dt>是否推荐：</dt>
                <dd>
                    <asp:RadioButton ID="rdbYes" runat="server" Text="是" GroupName="Recommend" /><asp:RadioButton
                        ID="rdbNo" runat="server" Text="否" Checked="true" GroupName="Recommend" />
                </dd>
            </dl>
            <dl>
                <dt>商品图片：</dt>
                <dd>
                    <asp:FileUpload ID="fuProductImg" runat="server" onchange="displayImg(this)" /><br />
                    <asp:Image ID="imgPic" runat="server" CssClass="imgpic" BorderWidth="1" ImageUrl="../Style/nopic.jpg" />
                </dd>
            </dl>
            <dl>
                <dt>备注：</dt>
                <dd>
                    <asp:TextBox ID="txbRemark" runat="server" CssClass="textBox" Height="50" Width="250" TextMode="MultiLine"></asp:TextBox>
                </dd>
            </dl>
            <dl style="margin-top: 10px">
                <dt>&nbsp;</dt>
                <dd>
                    <asp:Button ID="btnAdd" runat="server" Text="发布" CssClass="button_bg" OnClick="btnAdd_Click" />
                    &nbsp;
                    <asp:Button ID="btnReset" runat="server" Text="取消" CssClass="button_bg" OnClick="btnReset_Click" />
                </dd>
            </dl>
        </div>
    </div>
    </form>

    <script language="javascript" type="text/javascript">
        function displayImg(FileupLoad) {
            var type = FileupLoad.value;
            type = type.toLowerCase().substr(type.lastIndexOf("."));
            if (type != ".jpg" && type != ".gif" && type != ".jpeg" && type != ".bmp") {
                alert("图片类型不符请重新选择");
                var f = document.getElementById("fuProductImg");
                f.outerHTML = f.outerHTML;
                return false;
            }
            else {
                document.getElementById("imgPic").src = document.getElementById("fuProductImg").value;
            }
        } 
    </script>

</body>
</html>
